package com.jy.adscm.wechat.controller;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.jy.adscm.exception.AdscmSystemException;
import com.jy.adscm.support.SimpleCoreResponse;
import com.jy.adscm.utils.AdscmBaseUtils;
import com.jy.adscm.wechat.bean.CgMaterial;
import com.jy.adscm.wechat.bean.JqbzSettings;
import com.jy.adscm.wechat.service.JqbzSettingsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 * 机器部装设置 前端控制器
 * </p>
 *
 * @author zyl
 * @since 2019-09-29
 */
@RestController
@RequestMapping("/adscm/wechat/jqbzSettings")
public class JqbzSettingsController {
    @Autowired
    JqbzSettingsService jqbzSettingsService;
    @RequestMapping("selectAll")
    public SimpleCoreResponse insert(String  keywords , HttpServletRequest request)throws AdscmSystemException {
        Wrapper<JqbzSettings> wrapper=new EntityWrapper<>();
        if (AdscmBaseUtils.getInstance().isNotEmpty(keywords,null)){
            wrapper.like("name",keywords);
        }
        List<JqbzSettings> jqbzSettings = jqbzSettingsService.selectList(wrapper);
        return  new SimpleCoreResponse("200","查询成功",jqbzSettings);
    }
}

